// Copyright 2008 Senary
// See credits.txt for details.

// This file is part of Omega VII.

// Omega VII is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Omega VII is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Omega VII.  If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <windows.h>
#include <string>
#include <utility>

#include "sdk_engine/adll.h"

//abstract class to be implemented by all panel display
class Panel
{
protected:
	// The pointer to the GameStudio Panel
	PANEL* _pPanel;

	// position of the panel in pixels
	std::pair<int, int> _position;

	// layer of the panel (greater = on top)
	int _layer;

	// The string definition of the panel. Set this before
	// calling createPanel
	std::string _panelDefinition;
public:
	Panel(std::pair<int, int> position, int layer);
	virtual ~Panel(void);

	// gets the size of the panel (for centered positioning)
	std::pair<int, int> getSize();
	
	// Sets resp. changes the position of the panel
	void setPosition(std::pair<int, int> position);

	//create PANEL useable by engine
	virtual void createPanel(void);

	// param timestep: time since the last update, in seconds
	// param totalTime: total time the game has been running
	virtual void update(float timestep, float totalTime);

	// Makes the panel visible
	virtual void display();

	// Hides the panel
	virtual void hide();

	// Sets the opaqueness of the panel
	void setAlpha(int alpha);

	virtual bool isVisible(void);

	//determine if a coord point is within the "body" of this panel
	virtual bool withinRange(std::pair<int, int> position);
};
